package com.donger.common.messgae.config;

import com.donger.common.messgae.handler.JavaEmailMessaheHandler;
import com.donger.common.messgae.handler.MessageHandler;
import com.donger.common.messgae.handler.SmsAliyunMessageHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author aeizzz
 */
@Configuration
public class MessageConfiguration {

    @Autowired
    private SmsAliyunPropertiesConfig config;

    @Bean
    public MessageHandler smsAliyunMessageHandler(){
        return new SmsAliyunMessageHandler(config);
    }

    @Bean
    public MessageHandler javaEmailMessaheHandler(){
        return new JavaEmailMessaheHandler();
    }
}
